07. The Covariance Matrix and Quadratic Forms
L3 06 The Covariance Matrix And Quadratic Forms V1
The Covariance Matrix
Let's take a moment to learn a compact way to represent the portfolio variance using matrices and vectors.
Remember that the portfolio variance we calculated for our two-stock portfolio was:
But
This expression now has a nice parallel structure. If we create a matrix called the covariance matrix,
and a vector of weights:
and do the following matrix multiplication:
we see that we recover the expression for \sigma_P^2 .
So:
\sigma_P^2 = \mathbf{x}^\mathrm{T}\mathbf{P}\mathbf{x}
Quadratic Forms
A polynomial where the sums of the exponents of the variables in each term equals 2 is called a quadratic form. An example:
The portfolio variance is an example of a quadratic form (remember, x_A and x_B are the variables here):
A quadratic form can always been written as \mathbf{x}^\mathrm{T}\mathbf{P}\mathbf{x} , where P is a symmetric matrix.